<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <script src="js/jquery.min.js"></script>
    <script src="js/angular.min.js"></script>
    <script src="js/angular-ui-router.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
    <link rel="stylesheet" type="text/css" href="/less/index.css">
    <meta name="Author" content="npc-guangming">
    <title>练习</title>
</head>

<body ng-app='routingDemoApp' ng-init="firstName='John'">
    <div id="footer">
        <div id="home">
            <a href="#/"><img src="img/home.png">
                <label>首页</label>
            </a>
        </div>
        <div id="menu">
            <a href="#/add"><img src="img/add.png"></a>
        </div>
        <div id="myine">
            <a href="#/mine"><img src="img/mine.png">
                <label>我的</label>
            </a>
        </div>
    </div>
    <div ng-view></div>
    <script>
    var app = angular.module('routingDemoApp', ['ngRoute']);
    app.config(['$routeProvider', function($routeProvider) {
        $routeProvider
            .when('/', {
                templateUrl: '/html/home.html'
            })
            .when('/add', {
                templateUrl: '/html/add.html'
            })
            .when('/mine', {
                templateUrl: '/html/mine.html'
            })

    }]);

    app.controller("Home_pageC", function($scope) {

        var home_list = new Array("英语口语四级复习资料", "教师资格证报名表", "优秀毕业生申请表", "日语口语四级复习资料");
        $scope.items = home_list;
    });
    app.controller("add_pageC", function($scope) {

        var home_list = new Array("img/1.png", "img/2.png", "img/3.png");
        $scope.items = home_list;
        var timer = setInterval(function() {
            if ($("#add_list").outerHeight(true) != null) {
                console.log($("#add_list").outerHeight(true));
                var mheight = $("#add_list").outerHeight(true) + 80;
                $("#add_list").css("height", mheight + 'px');
                clearInterval(timer);
            }

        }, 30);


    });

    app.controller("mine_pageC", function($scope) {
    
          $scope.userName="咔咔咔";
          $scope.userLv="三星用户";
          $scope.userImg="/img/photo.png";

        var timer = setInterval(function() {
            if ($("#mine_list").outerHeight(true) != null) {
                console.log($("#add_list").outerHeight(true));
                var mheight = $("#add_list").outerHeight(true) + 80;
                $("#add_list").css("height", mheight + 'px');
                clearInterval(timer);
            }

        }, 30);

        function h_list() {
            this.img = "";
            this.title = "";

        }
        var list1 = new h_list();
        list1.img = "/img/myOrder.png";
        list1.title = "我的云印";
        var list2 = new h_list();
        list2.img = "/img/myyp.png";
        list2.title = "我的云盘";
        var list3 = new h_list();
        list3.img = "/img/address.png";
        list3.title = "地址管理";
        var list4 = new h_list();
        list4.img = "/img/question.png";
        list4.title = "意见反馈";
        var list5 = new h_list();
        list5.img = "/img/help.png";
        list5.title = "帮助中心";
        var list6 = new h_list();
        list6.img = "/img/aboutUs.png";
        list6.title = "关于我们";


        var home_list = new Array(list1, list2, list3, list4, list5, list6);
        $scope.items = home_list;
        setTimeout(function() {
            if ($("#add_list").outerHeight(true) != null) {
                var mheight = $("#add_list").outerHeight(true) + 80;
                $("#add_list").css("height", mheight + 'px');
            }
        }, 0);
        $scope.turnAction = function(codes) {
            var code = codes;
            switch (code) {
                case "我的云印":
                    window.location.href = "/html/myOrder.html";
                    break;
                case "意见反馈":
                    window.location.href = "/html/question.html";
                    break;
                case "我的云盘":
                    // window.location.href = "";
                    break;
                case "地址管理":
                    window.location.href = "/html/address.html";
                    break;
                case "关于我们":
                    window.location.href = "/html/aboutUs.html";
                    break;
                case "帮助中心":
                    window.location.href = "/html/help.html";
                    break;
            }

        }
    });
    </script>
</body>

</html>
